import { defineStore } from 'pinia'
import { getServiceProviderDetailAPI } from '@/api/serviceProvider'

interface ServiceProviderInfo {
  // 服务商信息
  serviceInfo: IServiceProviderDetail | object
}

export default defineStore('serviceProviderInfo', {
  state(): ServiceProviderInfo {
    return {
      serviceInfo: {}
    }
  },
  getters: {},
  actions: {
    async getServiceInfo(uid: string) {
      const { data } = await getServiceProviderDetailAPI({ uid })
      this.serviceInfo = data
    }
  }
})
